'''
Author: zhanwei xu
Date: 2023-05-02 15:04:22
LastEditors: zhanwei xu
LastEditTime: 2023-10-23 09:31:42
Description: 

Copyright (c) 2023 by zhanwei xu, Tsinghua University, All Rights Reserved. 
'''
from fastapi import FastAPI
from fastapi.middleware.cors import CORSMiddleware
from ChatAPI.chatapi import chat_router

from DataAPI import view as DataView
from DrawAPI.drawapi import draw_router
from FileAPI import view as FileView
from FileAPI_key import view as FileView_key
from ChatAPI_key.chatapi import key_router
from core import setting


app = FastAPI()
app.add_middleware(
    CORSMiddleware,
    allow_credentials=True,
    # allow_origins=["https://zaiwen.top", "https://www.zaiwen.top","http://zaiwen.top", "http://www.zaiwen.top"],
    allow_origins=["*"],
    allow_methods=["*"],
    allow_headers=["*"],
) 

@app.get("/")
async def main():
    return {"message":"Helloworld FastAPI"}

app.include_router(chat_router)
app.include_router(key_router)
app.include_router(draw_router)
app.include_router(DataView.router)
app.include_router(FileView.router)
app.include_router(FileView_key.router)
    
